#!/bin/bash

if ./wator hhh jjj ; then
    exit 1
elif ./wator -2 -1 -1 -1 20 -1 -1; then
    exit 1
else
    rm -f out1
    
    (./wator 100 100 10 5 10 200 20 | grep = ) 2>> out1 &
    echo inizio attesa
    sleep 2  
    echo fine attesa
    if ! killall wator; then
	exit 1;
    fi
    
    (./wator 1000 1000 10 5 10 200 400 -t 5 | grep = ) 2>> out1 &
    echo inizio attesa
    sleep 2 
    echo fine attesa
    if ! killall wator; then
	exit 1;
    fi
    
    (./wator 1500 1500 10 5 10 20 400 -t 30 | grep = ) 2>> out1  &
    echo inizio attesa
    sleep 2 
    echo fine attesa
    if ! killall wator; then
	exit 1;
    fi
    
fi
exit 0
